﻿using NUnit.Framework;

namespace CodeContrib.Tests
{
	public class MathExtensionsTests
	{
		[Test]
		public void IsEven_With_0_ShouldReturn_True()
		{
			// Arrange
			const bool expected = true;

			const int number = 0;

			// Act
			var actual = number.IsEven();

			// Assert
			Assert.AreEqual(expected, actual);
		}

		[Test]
		public void IsEven_With_1_ShouldReturn_False()
		{
			// Arrange
			const bool expected = false;

			const int number = 1;

			// Act
			var actual = number.IsEven();

			// Assert
			Assert.AreEqual(expected, actual);
		}

		[Test]
		public void IsEven_With_2_ShouldReturn_True()
		{
			// Arrange
			const bool expected = true;

			const int number = 2;

			// Act
			var actual = number.IsEven();

			// Assert
			Assert.AreEqual(expected, actual);
		}

		[Test]
		public void IsOdd_With_0_ShouldReturn_False()
		{
			// Arrange
			const bool expected = false;

			const int number = 0;

			// Act
			var actual = number.IsOdd();

			// Arrange
			Assert.AreEqual(expected, actual);
		}

		[Test]
		public void IsOdd_With_1_ShouldReturn_True()
		{
			// Arrange
			const bool expected = true;

			const int number = 1;

			// Act
			var actual = number.IsOdd();

			// Arrange
			Assert.AreEqual(expected, actual);
		}

		[Test]
		public void IsOdd_With_2_ShouldReturn_False()
		{
			// Arrange
			const bool expected = false;

			const int number = 2;

			// Act
			var actual = number.IsOdd();

			// Arrange
			Assert.AreEqual(expected, actual);
		}
	}
}